using System;
using System.Data.SqlTypes;
using System.Data.SqlClient;
using Microsoft.SqlServer.Server;

namespace SqlClrSample
{
	public class Demo
	{
		static public void EmployeeById(SqlInt32 employeeId)
		{
			using (SqlConnection cx = new SqlConnection("context connection=true"))
			{
				SqlCommand cmd = cx.CreateCommand();
				cmd.CommandText = "SELECT * "
									+ "FROM Employees "
									+ "WHERE EmployeeID = @EmployeeId";
				cmd.Parameters.AddWithValue("@EmployeeId", employeeId );
				cx.Open();
				SqlContext.Pipe.ExecuteAndSend(cmd);
			}
		}
	}
}